package org.csmz.class2333.innerclass;

public class Example19 {
    public static void learnSwim(Swim swim){
        swim.swimming();
    }
    public static void main(String[] args){
        String name ="小明";
        learnSwim(new Swim() {
            @Override
            public void swimming() {
                System.out.println(name+"学会了自由泳……");
            }
        });
        learnSwim(new Swim() {
            @Override
            public void swimming() {
                System.out.println(name+"学会了蛙泳……");
            }
        });
    }
}
